package com.iotechn.unimall.app.api.inspection;

import com.dobbinsoft.fw.core.annotation.HttpMethod;
import com.dobbinsoft.fw.core.annotation.HttpOpenApi;
import com.dobbinsoft.fw.core.annotation.HttpParam;
import com.dobbinsoft.fw.core.annotation.HttpParamType;
import com.dobbinsoft.fw.core.annotation.param.NotNull;
import com.dobbinsoft.fw.core.exception.ServiceException;
import com.dobbinsoft.fw.support.model.Page;
import com.iotechn.unimall.data.domain.InspectionDO;
import com.iotechn.unimall.data.dto.InspectionDTO;

import java.util.List;

/**
 * Generate Code By Unimall
 */
@HttpOpenApi(group = "app.inspection", description = "unimall_inspectionService")
public interface AppInspectionService {

    @HttpMethod(description = "删除", permission = "inspectionRecord:inspection:delete", permissionParentName = "其他", permissionName = "inspection")
    public boolean delete(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "id") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;


    @HttpMethod(description = "app巡检记录")
    public Page<InspectionDO> list(
            @HttpParam(name = "roundsId", type = HttpParamType.COMMON, description = "轮数id") Long roundsId,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit) throws ServiceException;

    @HttpMethod(description = "巡检")
    public String create(
            @NotNull @HttpParam(name = "str", type = HttpParamType.COMMON, description = "巡检列表") String str) throws ServiceException;

    @HttpMethod(description = "编辑", permission = "inspectionRecord:inspection:edit", permissionParentName = "其他", permissionName = "inspection")
    public String edit(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "主键") Long id,
            @NotNull @HttpParam(name = "roomName", type = HttpParamType.COMMON, description = "所属机房") String roomName,
            @NotNull @HttpParam(name = "roomId", type = HttpParamType.COMMON, description = "roomId") Long roomId,
            @NotNull @HttpParam(name = "equipmentType", type = HttpParamType.COMMON, description = "设备类型") String equipmentType,
            @NotNull @HttpParam(name = "equipmentNo", type = HttpParamType.COMMON, description = "设备编号") String equipmentNo,
            @NotNull @HttpParam(name = "equipmentId", type = HttpParamType.COMMON, description = "equipmentId") Long equipmentId,
            @NotNull @HttpParam(name = "runningStatus", type = HttpParamType.COMMON, description = "运行状态") Integer runningStatus,
            @NotNull @HttpParam(name = "photo", type = HttpParamType.COMMON, description = "附件") String photo,
            @NotNull @HttpParam(name = "inspectionPeople", type = HttpParamType.COMMON, description = "巡检人") Integer inspectionPeople,
            @NotNull @HttpParam(name = "rounds", type = HttpParamType.COMMON, description = "轮数") Integer rounds,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "设备记录", permission = "inspectionRecord:inspection:recordList", permissionParentName = "其他", permissionName = "equipment")
    public Page<InspectionDTO> recordList(
            @HttpParam(name = "equipmentId", type = HttpParamType.COMMON, description = "设备id") Long equipmentId,
//            @HttpParam(name = "equipmentType", type = HttpParamType.COMMON, description = "设备类型") String equipmentType,
//            @HttpParam(name = "equipmentNo", type = HttpParamType.COMMON, description = "设备编号") String equipmentNo,
//            @HttpParam(name = "room", type = HttpParamType.COMMON, description = "机房") String room,
            @HttpParam(name = "startDate", type = HttpParamType.COMMON, description = "开始日期") String startDate,
            @HttpParam(name = "endDate", type = HttpParamType.COMMON, description = "结束日期") String endDate,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "异常处理列表", permission = "inspectionRecord:inspection:exceptionHandlingList", permissionParentName = "其他", permissionName = "equipment")
    public Page<InspectionDTO> exceptionHandlingList(
            @HttpParam(name = "searchKeyWord", type = HttpParamType.COMMON, description = "模糊查询") String searchKeyWord,
            @HttpParam(name = "searchType", type = HttpParamType.COMMON, description = "状态查询（1未处理2已处理）") String searchType,
            @HttpParam(name = "room", type = HttpParamType.COMMON, description = "机房") String room,
            @HttpParam(name = "page", type = HttpParamType.COMMON, description = "页码", valueDef = "1") Integer page,
            @HttpParam(name = "limit", type = HttpParamType.COMMON, description = "页码长度", valueDef = "20") Integer limit,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "备注", permission = "inspectionRecord:inspection:remark", permissionParentName = "其他", permissionName = "inspection")
    public String remark(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "主键") Long id,
            @NotNull @HttpParam(name = "remarks", type = HttpParamType.COMMON, description = "备注") String remarks,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;

    @HttpMethod(description = "异常处理", permission = "inspectionRecord:inspection:exceptionHandling", permissionParentName = "其他", permissionName = "inspection")
    public String exceptionHandling(
            @NotNull @HttpParam(name = "id", type = HttpParamType.COMMON, description = "主键") Long id,
            @NotNull @HttpParam(name = "adminId", type = HttpParamType.ADMIN_ID, description = "管理员ID") Long adminId) throws ServiceException;
}
